export default {
	updateUserInfo(state, userInfo) {
		state.userInfo = userInfo
		// 同步到本地存储
		if (userInfo) {
			uni.setStorageSync('userInfo', userInfo)
		} else {
			uni.removeStorageSync('userInfo')
		}
	},
	setHistory(state, val) {
		let list = state.historyList;
		if (list.length > 0 && list.findIndex(item => item === val) > -1) return;
		list.unshift(val);
		uni.setStorageSync('historyList', list);
		state.historyList = list;
	},
	cleanHistory(state) {
		uni.removeStorageSync('historyList');
		state.historyList = [];
	},
	//设置导航栏选项卡
	setLabelList(state, labelList) {
		uni.setStorageSync('labelList', labelList);
		state.labelList = labelList
	}
}